<template>
  <div class="container">
    <div class="showInfo" @click="showInfo" v-if="$store.state.basicInfo.isShow"><i class="el-icon-circle-plus"></i></div>
    <el-row>
      <el-form
        :model="formInline"
        label-width="120px"
        @keyup.enter.native="search"
      >
        <el-col :span="8" align="left">
          <el-form-item :label="$t('m.in.ordernumber')">
            <el-input
              maxlength="30"
              show-word-limit
              v-model="formInline.ordercode"
            ></el-input>
          </el-form-item>
          <el-form-item label="SKU">
            <el-input
              maxlength="20"
              show-word-limit
              v-model="formInline.sku"
            ></el-input>
          </el-form-item>
          <el-form-item :label="$t('m.out.shopname')">
            <el-select
              filterable
              v-model="formInline.shopid"
              :placeholder="$t('m.choose')"
            >
              <el-option
                v-for="item in shop"
                :key="item.shopid"
                :label="item.shopname"
                :value="item.shopid"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8" align="left">
          <el-form-item :label="$t('m.out.storeordercode')">
            <el-input
              maxlength="20"
              show-word-limit
              v-model="formInline.storeordercode"
              placeholder
            ></el-input>
          </el-form-item>
          <el-form-item :label="$t('m.in.suppliercode')">
            <el-input
              maxlength="20"
              show-word-limit
              v-model="formInline.suppliercode"
              placeholder
            ></el-input>
          </el-form-item>
          <el-form-item :label="$t('m.out.address')">
            <el-select
              filterable
              v-model="formInline.regionid"
              :placeholder="$t('m.choose')"
            >
              <el-option
                v-for="item in region"
                :key="item.id"
                :label="item.regionname"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8" align="left">
          <el-form-item :label="$t('m.state')">
            <el-select
              v-model="formInline.stateid"
              :placeholder="$t('m.choose')"
            >
              <el-option
                v-for="item in states"
                :key="item.id"
                :label="item.label"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item :label="$t('m.out.ordertype')">
            <el-select
              v-model="formInline.ordertype"
              :placeholder="$t('m.choose')"
            >
              <el-option
                v-for="item in ordertype"
                :key="item.id"
                :label="item.label"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item :label="$t('m.out.priority')">
            <el-select
              v-model="formInline.priority"
              :placeholder="$t('m.choose')"
            >
              <el-option
                v-for="item in priority"
                :key="item.id"
                :label="item.label"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="24" align="right">
          <el-form-item>
            <el-button
              type="primary"
              @click="search"
              v-if="hasPermission('search')"
              >{{ $t("m.query") }}</el-button
            >
            <!-- <el-button
              :loading="isLoading"
              type="primary"
              @click="syncOMS"
              v-if="hasPermission('syncOMS')"
              >{{ $t("m.out.syncOMS") }}</el-button
            > -->
            <el-button
            :loading="isLoading"
              type="primary"
              @click="initWebsocket"
              v-if="hasPermission('syncOMS')"
              >{{ $t("m.out.syncOMS") }}</el-button
            >
            <!-- <el-button type="primary" @click="singleSyncOrder" v-if="hasPermission('sync')">{{$t('m.out.singleSync')}}</el-button> -->
            <el-button
              type="primary"
              @click="syncOrder"
              v-if="hasPermission('sync')"
              >{{ $t("m.out.sync") }}</el-button
            >
            <el-button
              type
              @click="pickingWave"
              v-if="hasPermission('pickingWave')"
              >{{ $t("m.out.wave") }}</el-button
            >
            <el-button
              @click="cancelOrder"
              v-if="hasPermission('cancelOrder')"
              >{{ $t("m.out.cancelOrder") }}</el-button
            >
            <!-- <el-button @click="getOrder" v-if="hasPermission('shortage')">{{
              $t("m.out.shortage")
            }}</el-button> -->
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
    <div class="ellipse"></div>
    <el-row>
      <el-col :span="24">
        <el-table
          ref="table"
          stripe
          empty-text
          fits
          :data="tableData"
          :row-style="tableRowStyle"
          :row-class-name="tableRowClassName"
          @row-click="rowClick"
          @selection-change="handleMultiSelectionChange"
          v-loading="tableLoading"
        >
          <el-table-column
            align="center"
            type="selection"
            width="55"
          ></el-table-column>
          <el-table-column
            align="center"
            type="index"
            :label="$t('m.index')"
            width="50"
          ></el-table-column>
          <el-table-column
            align="center"
            prop="ordercode"
            :label="$t('m.in.ordernumber')"
          >
            <template slot-scope="scope">
              <template v-if="hasPermission('table-ordercode')">
                <el-button
                  type="text"
                  @click.stop="
                    $router.push({
                      path: 'order/orderInfo',
                      query: { orderid: scope.row.orderid },
                    })
                  "
                  >{{ scope.row.ordercode }}</el-button
                >
              </template>
              <template v-else>{{ scope.row.ordercode }}</template>
            </template>
          </el-table-column>
          <el-table-column
            align="center"
            prop="storeordercode"
            :label="$t('m.out.storeordercode')"
          ></el-table-column>
          <el-table-column
            :label="$t('m.out.applydate')"
            align="center"
            prop="applydate"
            :formatter="applydateFormatter"
          ></el-table-column>
          <el-table-column
            :label="$t('m.in.auditdate')"
            align="center"
            prop="auditordate"
            :formatter="auditordateFormatter"
          ></el-table-column>
          <el-table-column
            :label="$t('m.out.priority')"
            align="center"
            prop="priority"
            :formatter="priorityFormatter"
          ></el-table-column>
          <el-table-column
            :label="$t('m.state')"
            width="100"
            align="center"
            prop="statetext"
          ></el-table-column>
          <el-table-column
            :label="$t('m.out.stockstate')"
            width="100"
            align="center"
            prop="stockstate"
            :formatter="stockstataFormatter"
          ></el-table-column>
          <el-table-column :label="$t('m.out.ordertype')" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.ordertype == 1">{{
                $t("m.out.ordertype1")
              }}</span>
              <span v-if="scope.row.ordertype == 2">{{
                $t("m.out.ordertype2")
              }}</span>
            </template>
          </el-table-column>
          <el-table-column
            align="center"
            prop="totalnumber"
            :label="$t('m.out.totalnumber')"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            prop="payment"
            :label="$t('m.strategy.payment')"
          >
            <template slot-scope="scope">
              <span v-if="scope.row.payment == 1">{{
                $t("m.out.paytype1")
              }}</span>
              <span v-if="scope.row.payment == 2">{{
                $t("m.out.paytype2")
              }}</span>
            </template>
          </el-table-column>
          <el-table-column
            align="center"
            prop="consignee"
            :label="$t('m.out.consignee')"
            show-overflow-tooltip
          ></el-table-column>
          <!-- <el-table-column align="center" prop="contact" :label="$t('m.out.contact')" show-overflow-tooltip></el-table-column> -->
          <!-- <el-table-column align="center" prop="provincename" :label="$t('m.out.provincename')" show-overflow-tooltip></el-table-column> -->
          <!-- <el-table-column align="center" prop="cityname" :label="$t('m.out.cityname')" show-overflow-tooltip></el-table-column> -->
          <!-- <el-table-column align="center" prop="regionname" :label="$t('m.out.regionname')" show-overflow-tooltip></el-table-column> -->
          <!-- <el-table-column align="center" prop="shippingaddress" :label="$t('m.out.address')" show-overflow-tooltip></el-table-column> -->
        </el-table>

        <el-pagination
          background
          layout="sizes, prev, pager, next, jumper"
          :page-sizes="pageSizeList"
          :page-size="rowSize"
          :current-page="page"
          :total="totalRows"
          @current-change="currentChangeInitFn"
          @size-change="handleSizeChangeInitFn"
        ></el-pagination>
      </el-col>
    </el-row>

    <!-- 生成拣货波次 dialog 开始 -->
    <el-dialog
      :close-on-click-modal="false"
      @close="close('pickingForm')"
      width="400px"
      :title="$t('m.out.create')"
      :visible.sync="dialogFormVisible"
    >
      <el-form align="left" ref="pickingForm" :model="pickingForm">
        <el-form-item
          :rules="[
            {
              required: true,
              message: $t('m.choose') + $t('m.out.template'),
              trigger: 'change',
            },
          ]"
          size="mini"
          :label="$t('m.out.template')"
          label-width="150px"
          prop="wavetemplateid"
        >
          <el-select
            v-model="pickingForm.wavetemplateid"
            :placeholder="$t('m.choose')"
          >
            <el-option
              v-for="item in waveList"
              :key="item.wavetemplateid"
              :label="item.wavetemplatename"
              :value="item.wavetemplateid"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item
          :rules="[
            {
              required: true,
              message: $t('m.choose') + $t('m.out.pickingType'),
              trigger: 'change',
            },
          ]"
          size="mini"
          :label="$t('m.out.pickingType')"
          label-width="150px"
          prop="pickingType"
        >
          <el-select
            v-model="pickingForm.pickingType"
            :placeholder="$t('m.choose')"
          >
            <el-option
              v-for="item in pickingtype"
              :key="item.id"
              :label="item.label"
              :value="item.id"
            ></el-option>
          </el-select>
        </el-form-item>
        <div class="btns">
          <el-button size="mini" @click="close('pickingForm')">{{
            $t("m.cancel")
          }}</el-button>
          <el-button size="mini" type="primary" @click="saveWave">{{
            $t("m.confirm")
          }}</el-button>
        </div>
      </el-form>
    </el-dialog>
    <!-- 生成拣货波次 dialog 结束 -->
    <!-- 缺货上报 -->
    <el-dialog
      :close-on-click-modal="false"
      @close="dialogFormVisible2 = false"
      width="600px"
      :title="$t('m.out.shortage')"
      :visible.sync="dialogFormVisible2"
    >
      <el-form :model="tableForm" ref="tableForm" label-width="0">
        <el-table :data="tableForm.saleorderdetail" style="width: 100%">
          <el-table-column
            prop="productspeccode"
            label="SKU"
            width="180"
          ></el-table-column>
          <el-table-column
            prop="stockoutquantity"
            :label="$t('m.pick.shortageqty')"
          ></el-table-column>
          <el-table-column prop="name" :label="$t('m.check.count')" width="180">
            <template slot-scope="scope">
              <!-- :prop="'batchattrrulelist.'+scope.$index+'.display'" -->
              <el-form-item
                :prop="'saleorderdetail.' + scope.$index + '.quantity'"
                :rules="{
                  required: true,
                  message: $t('m.enter') + $t('m.check.count'),
                  trigger: 'blur',
                }"
              >
                <el-input v-model="scope.row.quantity"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
        </el-table>
      </el-form>
      <el-button size="mini" type="primary" @click="saveShotage">{{
        $t("m.confirm")
      }}</el-button>
    </el-dialog>
    <orderTipsPopup
      v-if="orderTipsPopupVisible"
      :popupVisible="orderTipsPopupVisible"
      :title="orderTipsPopupTitle"
      :detail="orderTipsPopupData"
      @close="orderTipsPopupVisible = false"
    ></orderTipsPopup>
    <websocketPopup
      v-if="websocketPopupVisible"
      :popupVisible="websocketPopupVisible"
      :title="websocketPopupTitle"
      :detail="websocketPopupData"
      @close="closeInfo"
    ></websocketPopup>
  </div>
</template>

<script>
import common from '@/utils/common'
import orderTipsPopup from '@/components/order/order-tips-popup'
import websocketPopup from '@/components/order/websocket-popup'
export default {
  data(){
    return {
      orderTipsArr:[],
      socket:'',
      isLoading:false,
      dynamicValidateForm:{},
      tableForm:{},
      formInline:{
        ordercode:'',
        ordertype:'',
        regionid:null,
        shopid:null,
        sku:'',
        stateid:'',
        storeordercode:'',
        suppliercode:null,
        priority:''
      },
      tableData:[],
      dialogFormVisible:false,
      dialogFormVisible2:false,
      shop:[],
      region:[],
      waveList:[],
      pickingForm:{
        wavetemplateid:'',
        pickingType:'',
        orderids:[]
      },
      orderTipsPopupVisible:false,
      websocketPopupVisible:false,
      orderTipsPopupTitle:'',
      websocketPopupTitle:'',
      orderTipsPopupData:'',
      websocketPopupData:''
    }
  },
  components:{ orderTipsPopup, websocketPopup },
  watch:{
    // 切换语言更改下拉框里的语言
    '$i18n.locale'(){
      this.getShop()
      this.getRegion()
    }
  },
  filters:{
    // 1 待处理 2 待拣货 3 拣货中 4 已完成 5 已取消
    stateFilter(value, lan){
      return [
        lan('m.quality.state1'),
        lan('m.out.state2'),
        lan('m.out.state3'),
        lan('m.shelves.state5'),
        lan('m.shelves.state3')
      ][value - 1]
    }
  },
  computed:{
    states(){
      return [
        {
          id:null,
          label:this.$t('m.all')
        },
        {
          id:1,
          label:this.$t('m.quality.state1')
        },
        {
          id:2,
          label:this.$t('m.out.state2')
        },
        {
          id:3,
          label:this.$t('m.out.state3')
        },
        {
          id:4,
          label:this.$t('m.review.state1')
        },
        {
          id:5,
          label:this.$t('m.out.state5')
        },
        {
          id:6,
          label:this.$t('m.packaging.state1')
        }
      ]
    },
    priority(){
      return [
        {
          id:null,
          label:this.$t('m.all')
        },
        {
          id:0,
          label:this.$t('m.out.normal')
        },
        {
          id:1,
          label:this.$t('m.out.priority1')
        }
      ]
    },
    ordertype(){
      return [
        {
          id:null,
          label:this.$t('m.all')
        },
        {
          id:1,
          label:this.$t('m.out.ordertype1')
        },
        {
          id:2,
          label:this.$t('m.out.ordertype2')
        }
      ]
    },
    pickingtype(){
      return [
        {
          id:1,
          label:this.$t('m.out.pickingtype1')
        },
        {
          id:2,
          label:this.$t('m.out.pickingtype2')
        }
      ]
    }
  },
  methods:{
    showInfo(){
      this.websocketPopupVisible=true
      this.$store.commit('setIsShow',false)
    },
    closeInfo(){
      this.websocketPopupVisible=false
      this.$store.commit('setIsShow',true)
    },
    // path:'ws://192.168.50.167:9909/ws/pullorders',
    initWebsocket(){
      this.websocketPopupTitle = this.$t('m.out.syncOMS')
      this.orderTipsArr = []
      let path = window._config_.baseUrl.replace('http', 'ws')//ws://192.168.50.167:9909
      // this.init()
      if (typeof (WebSocket) === 'undefined'){
        alert('您的浏览器不支持socket')
      } else {
        let id = this.$store.state.basicInfo.userInfo.id
        // 实例化socket
        this.socket = new WebSocket(`${path}/ws/pullorders?userid=${id}`)
        // 监听socket连接
        this.socket.onopen = this.websockOpen
        // 监听socket错误信息
        this.socket.onerror = this.websockError
        // 监听socket消息
        this.socket.onmessage = this.websockMessage
        this.syncOMS()
        this.websocketPopupVisible = true
      }
    },
    websockOpen(){
      console.log('监听打开')
    },
    websockClose(){
      console.log('监听关闭')
    },
    websockError(){
      console.log('监听异常')
    },
    websockMessage(e){
      console.log('监听服务器发送的消息', e.data)
      this.orderTipsArr.push(e.data)
      let abstract = ''
      let content = this.orderTipsArr
      this.websocketPopupData = { abstract, content }
    },
    syncOMSCallback(data){
      let resData = data || ''
      if (resData){
        let abstract = ''
        let content = resData.split(';')
        if (!content[content.length - 1]) content.pop()
        this.orderTipsPopupTitle = `${this.$t('m.in.sync')}`
        this.orderTipsPopupData = { abstract, content }
        this.orderTipsPopupVisible = true
      }
      this.page = 1
      this.init()
    },
    cancelOrder(){
      if(this.tableRowSelected.length!==1){
        this.$message.error(this.$t('m.out.choose') + this.$t('m.out.order'))
      }else{
        if (
          this.tableRowSelected.filter(function (item){
            return item.stateid !== 1
          }).length > 0
        ){
          this.$message(this.$t('m.send.limit'))
        } else {
          let ids=this.tableRowSelected.map((item)=>item.orderid).join(',')
          this.$axios({
            method:'post',
            url:`/saleorder/cancel`,
            params:{
              orderid:ids
            }
          }).then(({ message }) => {
            this.callbackMessage(message, 'success')
            this.init()
          })
        }
      }
    },
    getOrder(){
      if (this.tableRowSelected.length !== 1){
        return this.$message({
          showClose:true,
          message:this.$t('m.out.choose') + this.$t('m.out.order'),
          type:'warning',
          duration:1000
        })
      } else {
        if (this.tableRowSelected[0].stateid === 15){
          this.dialogFormVisible2 = true
          this.$axios({
            method:'get',
            url:`/saleorder/query/${this.tableRowSelected[0].orderid}`
          }).then(({ data }) => {
            this.tableForm = data
          })
        } else {
          return this.$message({
            showClose:true,
            message:this.$t('m.out.choose') + this.$t('m.out.stock'),
            type:'warning',
            duration:1000
          })
        }
      }
    },
    lan(arg){
      return this.$t(arg)
    },
    init(){
      let address = ''
      if (this.formInline.regionid){
        address = this.region.filter(v => {
          return this.formInline.regionid === v.id
        })[0].regionname
      } else {
        address = ''
      }
      this.tableLoading = true
      this.$axios({
        method:'get',
        url:'/saleorder/page',
        params:{
          page:this.page,
          rows:this.rowSize,
          ordercode:this.formInline.ordercode,
          ordertype:this.formInline.ordertype,
          shippingaddress:address,
          shopid:this.formInline.shopid,
          sku:this.formInline.sku,
          stateid:this.formInline.stateid,
          storeordercode:this.formInline.storeordercode,
          warehouseid:this.$store.state.basicInfo.warehouseInfo.id,
          suppliercode:this.formInline.suppliercode,
          priority:this.formInline.priority
        }
      }).then(({ data }) => {
        for (let i = 0;i < data.records.length;i++){
          data.records[i].receivingdate = common.timestampToTime(
            data.records[i].receivingdate
          )
        }

        this.tableData = data.records
        this.totalRows = data.total
        setTimeout(() => this.tableLoading = false, 500)
      })
    },
    search(){
      this.page = 1
      this.init()
    },
    syncOMS(){
      this.isLoading = true
      let options = {
        method:'post',
        url:'/saleorder/pullorders',
        timeout:60000,
        data:{
          pageNum:1,
          pageSize:2000
        }
      }
      this.$axios(options).then(() => {
        // this.callbackMessage(message, 'success')
        this.init()
        this.isLoading = false
      }).catch(() => {
        this.isLoading = false
      })
    },
    // 同步单个订单btn
    singleSyncOrder(){
      this.$prompt(`${this.$t('m.out.orderNoTips')}`, `${this.$t('m.out.singleSync')}`, {
        confirmButtonText:`${this.$t('m.confirm')}`,
        cancelButtonText:`${this.$t('m.cancel')}`,
        inputPattern:/^[\s\S]*.*[^\s][\s\S]*$/,
        inputErrorMessage:`${this.$t('m.out.orderNoValidate')}`
      }).then(({ value }) => {
        let options = {
          method:'post',
          url:`/saleorder/syncorder/?orderCode=${value}`
        }
        this.$axios(options).then(({ data, message }) => {
          this.callbackMessage(message, 'success')
          this.syncCallback(data)
        })
      }).catch(() => {
        this.callbackMessage(`${this.$t('m.cancel')}`, 'info')
      })
    },
    // 全部订单同步button
    syncOrder(){
      let options = {
        method:'post',
        url:'/saleorder/sync'
      }
      this.$axios(options).then(({ data, message }) => {
        this.callbackMessage(message, 'success')
        this.syncCallback(data)
      })
    },
    // 同步订单后，统一回调处理
    syncCallback(data){
      let resData = data || ''
      if (resData){
        let abstract = resData.substring(0, resData.indexOf(';') + 1)
        resData = resData.substring(resData.indexOf(';') + 1)
        let content = resData.split(';')
        if (!content[content.length - 1]) content.pop()
        this.orderTipsPopupTitle = `${this.$t('m.in.sync')}`
        this.orderTipsPopupData = { abstract, content }
        this.orderTipsPopupVisible = true
      }
      this.page = 1
      this.init()
    },
    close(formName){
      this.$refs[formName].resetFields()
      this.dialogFormVisible = false
      this.init()
    },
    getShop(){
      this.$axios({
        method:'get',
        url:'/shopinfo/list'
      }).then(({ data }) => {
        this.shop = data
        this.shop.unshift({
          shopid:null,
          shopname:this.$t('m.all')
        })
      })
    },
    getRegion(){
      this.$axios({
        method:'get',
        url:'/region/tree/1'
      }).then(({ data }) => {
        this.region = data
        this.region.unshift({
          id:null,
          regionname:this.$t('m.all')
        })
      })
    },
    orderInfo(){
      if (this.tableRowSelected.length > 0){
        let orderid = this.tableRowSelected[0].orderid
        let routeData = this.$router.resolve({
          path:'order/editOrder',
          query:{ orderid:orderid }
        })
        window.open(routeData.href, '_self')
      } else {
        this.$message({
          showClose:true,
          message:this.$t('m.out.orderSyncTips'),
          type:'warning',
          duration:1000
        })
      }
    },
    pickingWave(){
      let that = this
      // if (that.tableRowSelected.length < 1){
      //   return that.$message({
      //     showClose:true,
      //     message:that.$t('m.choose') + that.$t('m.out.order'),
      //     type:'warning',
      //     duration:1000
      //   })
      // }
      if (
        that.tableRowSelected.filter(function (item){
          return item.stateid !== 1
        }).length > 0
      ){
        that.$message(that.$t('m.out.limit'))
      } else {
        that.getWaveList()
        that.dialogFormVisible = true
      }
    },
    getWaveList(){
      this.$axios({
        method:'get',
        url:'/wavetemplate/list'
      }).then(({ data }) => {
        this.waveList = data
      })
    },
    saveShotage(){
      this.$refs['tableForm'].validate(valid => {
        if (valid){
          this.$axios({
            method:'post',
            url:'saleorder/outstock',
            data:this.tableForm.saleorderdetail
          }).then(() => {
            this.dialogFormVisible2 = false
            this.$message({
              showClose:true,
              message:this.$t('m.quality.success'),
              type:'success',
              duration:1000
            })
          })
        }
      })
    },
    // 生成拣货波次
    saveWave(){
      this.$refs['pickingForm'].validate(valid => {
        if (valid){
          let { pickingType:pickingtype, wavetemplateid } = this.pickingForm
          let orderids = []
          if (this.tableRowSelected.length > 0){
            orderids = (this.pickingForm.orderids = this.tableRowSelected.map(
              item => {
                return item.orderid
              }
            )).join(',')
          } else {
            orderids = ''
          }
          this.$axios({
            method:'get',
            url:'/waveorder/formwaveorder',
            timeout:60000,
            params:{
              orderids:orderids,
              pickingtype,
              wavetemplateid
            }
          }).then(({ data }) => {
            this.dialogFormVisible = false
            this.callbackMessage(this.$t('m.out.wavesuccess'), 'success')
            let resData = data || ''
            if (resData){
              let content = resData.split(';')
              if (!content[content.length - 1]) content.pop()
              this.orderTipsPopupTitle = `${this.$t('m.out.wave')}`
              this.orderTipsPopupData = { content }
              this.orderTipsPopupVisible = true
            }
            this.init()
          })
        }
      })
    },
    // 表格状态过滤
    stockstataFormatter(row){
      return row.stockstata ? this.$t('m.out.lack') : this.$t('m.out.normal')
    },
    applydateFormatter(row){
      return common.timestampToTime(row.applydate)
    },
    auditordateFormatter(row){
      return common.timestampToTime(row.auditordate)
    },
    priorityFormatter(row){
      return row.priority == 1 ? this.$t('m.out.priority1') : this.$t('m.out.normal')
    }
  },
  activated(){
    this.init()
    this.getRegion()
    this.getShop()
  },
  created(){
    this.$store.commit('setIsShow',false)
  },
  destroyed(){
    // 销毁监听
    this.socket.onclose = this.websockClose
  }
}
</script>
<style lang="scss" scoped>
.el-select {
  width: 100%;
}
.showInfo{
  position: fixed;
  left: 0;
  bottom: 100px;
  z-index: 99;
  cursor: pointer;
}
.showInfo i{
  font-size: 30px;
}
</style>